package com.md.api.dao;

import com.md.api.entity.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ShoppingSpuMapper {
    int deleteByPrimaryKey(Long id);

    int newSpu(ShoppingSpu record);

    int updateSpu(ShoppingSpu record);
    int downOrUp(ShoppingSpu record);
    ShoppingSku skuDetail(@Param("spuId") String spuId, @Param("attributeValueIds") List<String> attributeValueIds);

    List<ShoppingSpu> list(@Param("keyword") String keyword,
                           @Param("serviceType") Integer serviceType,
                           @Param("type") Integer type,
                           @Param("saleStatus")Integer saleStatus);

    List<ShoppingSpu> sysList(@Param("keyword") String keyword,
                           @Param("type") Integer type,
                           @Param("saleStatus")Integer saleStatus);

    ShoppingSpu getBaseInfo(@Param("spuId") String spuId);

    List<ShoppingSpuAttributeRelation> getPublicAttr(@Param("spuId") String spuId);
    List<ShoppingAttribute> getPrivateAttr(@Param("spuId") String spuId);

    List<ShoppingSpu> recommend();

    List<ShoppingSpu> getNew();

    int updateScore(@Param("spuId")String spuId);
    Integer listingSku(@Param("spuId")String spuId);

    void onceShoppingSetting(ShoppingSku sku);

    int setLowerPrice(@Param("spuId")String spuId);
    int deleteBySpuId(@Param("spuId")String spuId);

    Double getLowerMoney(@Param("spuIds")List<String> spuIds);
}